﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using ZhangLogSysV1d0;

namespace TmU220PrintHelperV2d0.Entity
{
    /// <summary>
    /// API接口集类 3.0
    /// </summary>
    [XmlRoot("Api接口")]
    public class ApiInterfaceSetV3d0
    {
        /// <summary>
        /// 项目名称
        /// </summary>
        [XmlElement("项目名称")]
        public string ProjectName { get; set; }
        [XmlElement("项目主地址")]
        public string ProjectMainUrl { get; set; }
        [XmlElement("接口版本")]
        public string InterfaceVersion { get; set; }
        /// <summary>
        /// 接口集
        /// </summary>
        [XmlArray("接口集"), XmlArrayItem("接口")]
        public List<ApiInterfaceV3d0> ApiInterfaceList { get; set; }
        public ApiInterfaceSetV3d0()
        {
            ProjectName = "默认项目";
            ApiInterfaceList = new List<ApiInterfaceV3d0>();
        }  
    }
    /// <summary>
    /// Api接口
    /// </summary>
    public class ApiInterfaceV3d0
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        [XmlElement("InterfaceName")]
        public string InterfaceName { get; set; }
        /// <summary>
        /// 接口描述
        /// </summary>
        [XmlElement("InterfaceDescribe")]
        public string InterfaceDescribe { get; set; }
        /// <summary>
        /// 接口方法
        /// </summary>
        [XmlElement("InterfaceMethod")]
        public string InterfaceMethod { get; set; }
        /// <summary>
        /// 接口类型
        /// </summary>
        [XmlElement("InterfaceType")]
        public string InterfaceType { get; set; }
        /// <summary>
        /// 接口消息体模板
        /// </summary>
        [XmlElement("MessageBody")]
        public string MessageBody { get; set; }
        public ApiInterfaceV3d0()
        {
            InterfaceName = string.Empty;
            InterfaceDescribe = string.Empty;
            InterfaceMethod = string.Empty;
            InterfaceType = "get";
            MessageBody = string.Empty;
        }
        public ApiInterfaceV3d0(string name, string describe, string method, string messageBody, string type = "get")
        {
            InterfaceName = name;
            InterfaceDescribe = describe;
            InterfaceMethod = method;
            InterfaceType = type;
            MessageBody = messageBody;

        }
    }
}
